package org.tgcloud.group.web.controller.manager.notify;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;
import org.tgcloud.group.core.APPResultMessage;
import org.tgcloud.group.core.custom.Permissions;
import org.tgcloud.group.core.session.Session;
import org.tgcloud.group.service.manager.notify.NotifyService;
import org.tgcloud.group.web.controller.dto.project.file.ProjectFileDTO;
import org.tgcloud.group.web.controller.manager.ManageAPPBaseController;
import org.tgcloud.group.web.controller.req.notify.notifyManageReq.NotifyIdsReq;
import org.tgcloud.group.web.controller.req.notify.notifyManageReq.NotifyManageListReq;
import org.tgcloud.group.web.controller.req.project.file.FileSearchReq;

import java.util.List;

/**
 * @Author: zhy
 * @Created: 2025-09-09-下午6:48
 * @Description:
 */
@Api(tags = "消息管理相关接口")
@RestController
@RequestMapping("/manager/pc/user")
@EnableAutoConfiguration
public class NotifyManageController extends ManageAPPBaseController {

    @Autowired
    private NotifyService notifyService;


    @ApiOperation(value = "消息列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "string"),
    })
    @ResponseBody
    @RequestMapping(value = "/notifyList", method = RequestMethod.POST)
    public APPResultMessage getNotifyList(@RequestBody NotifyManageListReq req,
                                          @ModelAttribute("session") Session session) {
        return notifyService.getNotifyList(req, session.getUserId(), session.getUserType());
    }


    @ApiOperation(value = "批量已读")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "token", required = true, dataType = "string"),
    })
    @ResponseBody
    @RequestMapping(value = "/readBatchNotify", method = RequestMethod.POST)
    public APPResultMessage doReadBatchNotify(@RequestBody NotifyIdsReq req) {
        return notifyService.doReadBatchNotify(req);
    }

}
